{extend name="admin@index_layout"/}
{block name="main"}
<div class="layui-card">
    <div class="layui-card-header">信息列表</div>
    <div class="layui-card-body">
        <table class="layui-hide" id="currentTable" lay-filter="currentTable"></table>
    </div>
</div>
<script type="text/html" id="barTool">
    {{#  if(!d.iffixed){ }}
    <a data-open='{:url("public_view",["formid"=>$formid])}?id={{ d.id }}' data-width="800" data-height="600" class="layui-btn layui-btn-xs">查看</a>
    <a href='{:url("del",["formid"=>$formid])}?id={{ d.id }}' class="layui-btn layui-btn-danger layui-btn-xs layui-tr-del"><i class='iconfont icon-trash_fill'></i></a>
    {{#  } }}
</script>
{/block}
{block name="script"}
<script>
layui.use('yznTable', function() {
    var table = layui.yznTable;

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTable',
        delete_url: "{:url('del',['formid'=>$formid])}",
    };

    table.render({
        init: init,
        toolbar: ['refresh',
            [{
                html: '<a class="layui-btn layui-btn-sm" type="button" href="{:url("formguide/index")}"><i class="iconfont icon-undo"></i>&nbsp;返回</a>'
            }], 'delete',
        ],
        url: '{:url("index",["formid"=>$formid])}',
        cols: [
            [
                { type: 'checkbox', fixed: 'left' },
                { field: 'id', width: 60, title: 'ID' },
                {$formStr|raw}
                {field: 'ip', width: 150, title: 'IP' },
                { field: 'inputtime', width: 180, title: '创建时间', search: 'range' },
                { fixed: 'right', width: 100, title: '操作', templet: '#barTool' }
            ]
        ],
        page: {}
    });
});
</script>
{/block}